//
//  VCOfHeaderPicture.m
//  XYFMApp
//
//  Created by 岁变 on 16/9/5.
//  Copyright © 2016年 岁变. All rights reserved.
//

#import "VCOfHeaderPicture.h"
#import "XYMacro.h"

@interface VCOfHeaderPicture ()
@property (nonatomic, strong) UIImageView *picImageView;
@end

@implementation VCOfHeaderPicture

- (void)viewDidLoad {
    [super viewDidLoad];
    [self configNavigationController];
    [self configViewController];
    // Do any additional setup after loading the view.
}


- (void)configNavigationController {
    self.navigationController.navigationBar.barTintColor = [UIColor blackColor];
    self.title = _titleStr;
    self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor]};
    UIButton *goBackButton = [UIButton buttonWithType:UIButtonTypeCustom];
    goBackButton.frame = CGRectMake(0, 0, 30, 30);
    [goBackButton setImage:[UIImage imageNamed:@"go_back"] forState:UIControlStateNormal];
    [goBackButton addTarget:self action:@selector(goBack:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc] initWithCustomView:goBackButton];
    self.navigationItem.leftBarButtonItem = leftItem;
    
}

- (void)configViewController {
    UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - 64)];
    backView.backgroundColor = [UIColor colorWithRed:0.17 green:0.17 blue:0.17 alpha:1.00];
    [self.view addSubview:backView];
    _picImageView = [[UIImageView alloc] init];
    _picImageView.frame = CGRectMake(0, 150, SCREEN_WIDTH, backView.frame.size.height - 300);
    [_picImageView sd_setImageWithURL:[NSURL URLWithString:_picUrl] placeholderImage:PLACEHOLDERIMAGE];
    [backView addSubview:_picImageView];
    
}


- (void)goBack:(UIButton *)button {
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)viewDidAppear:(BOOL)animated {
    self.tabBarController.tabBar.hidden = YES;
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
